<?php
class Admin_Form_OrderUser extends Zend_Form {

	protected $_user;
	protected $_submit;

	public function init() {
		$this->_user = new Zend_Form_Element_Select('user');
		$this->_user->setLabel('Choosen user');
		
		$this->_submit = new Zend_Form_Element_Submit('submit');
		$this->_submit->setLabel('Go');
		$this->addElements(array($this->_user, $this->_submit));
	}

	public function bindData($users) {
		$data = array();
		foreach ($users as $user) {
			$data[$user->_uid] = $user->_fullname;
		}
		$this->_user->setMultiOptions($data);
	}

	public function populateData(Front_Model_User $user) {
		if (isset($user->_uid)) {
			$this->_user->setValue($user->_uid);
		}
	}
}